package com.whty.cms.filewps.upload.service;


import com.whty.cms.filewps.common.service.BaseService;
import com.whty.cms.filewps.upload.dto.AttachFile;
import com.whty.cms.filewps.upload.dto.TransformJob;
import net.sf.json.JSONObject;

import java.io.InputStream;

public interface IUploadService extends BaseService<AttachFile>{
	
	
    AttachFile findAttchFile(Long fid);


    TransformJob findTransformJob(String transformId);
    
    /**
     * 针对极速秒传文件，重新生成一份附件信息
     * @param fid
     * @param fid
     * @param attach
     * @throws Exception
     */
    void insertRepeatFile(long fid, AttachFile attach) throws Exception;
    
    
    
    /**
     * 保存文件信息
     * @param attach
     * @return
     * @throws Exception
     */
    AttachFile finishUploadFile(AttachFile attach) throws Exception;
    
    /**
     * 根据回调事件返回值修改转码表和es的相关信息
     * @param data
     * @throws Exception
     */
    boolean saveTransformInfo(JSONObject data) throws Exception;
    
    AttachFile SimpleUploadFile(AttachFile attach, InputStream in) throws Exception;

    /**
     * 修复bucketName为null的数据
     * @param fid
     */
    void fixBucketNameISNull(String fid);

    /**
     * 解析转码回调的数据
     * @param fid
     * @param data
     * @return
     * @throws Exception
     */
    boolean saveTransformInfoForV5(String fid, cn.hutool.json.JSONObject data) throws Exception;
}
